// 分享到微信和朋友圈的js
export default{
	data(){
        return {
		    // 设置默认的分享参数
            share: {
                title:'嗨美汇是一个为百业赋能的数字化营销平台',
                path:'/pages/index/index',
                imageUrl:'http://hmh-app.oss-cn-beijing.aliyuncs.com/webStorage/web_17020241755257303.jpg',
                desc:'嗨美汇',
                content:''
            }
        }
    },
    onShareAppMessage(res) {
        return {
            title: this.share.title,
            path: this.share.path,
            imageUrl: this.share.imageUrl,
            desc: this.share.desc,
            content: this.share.content,
            success(res) {
                uni.showToast({
                    title:'分享成功'
                })
            },
            fail(res) {
                uni.showToast({
                    title:'分享失败',
                    icon:'none'
                })
            }
        }
    },
	onShareTimeline(res) {
	    return {
	        title: this.share.title,
	        path: this.share.path,
	        imageUrl: this.share.imageUrl,
	        desc: this.share.desc,
	        content: this.share.content,
	        success(res) {
	            uni.showToast({
	                title:'分享成功'
	            })
	        },
	        fail(res) {
	            uni.showToast({
	                title:'分享失败',
	                icon:'none'
	            })
	        }
	    }
	}
}
